home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / ntxmeter.zip / NTXMET.NEW next >
Text File  |  1990-07-26  |  1KB  |  48 lines

  1. FUNCTION ntxmeter
  2. PARAMETERS keyer,_meterline
  3. PRIVATE keyer,_meterline,_percent
  4.  
  5. SET Cursor OFF
  6.  
  7. * increment in tens or 100s
  8.  
  9. inc = IIF(RECCOUNT() < 100,10,100)
  10.  
  11. IF .NOT. EOF()
  12.    IF (EMPTY(INDEXKEY(Indexord()))) .AND. (EMPTY(INDEXKEY(1)))
  13.       IF RECNO()%inc = 0 .OR. (LASTREC() - RECNO()) < inc
  14.         * numeric counter number
  15.         @ _meterline-02,45 SAY STR(RECNO(),LEN(LTRIM(STR(Lastrec()))))
  16.       
  17.         * moving meter bar routine
  18.         _percent = RECNO()/Lastrec()*60
  19.         @ _meterline,10 SAY REPLICATE('█',_percent)
  20.         Setcolor(tmpcolor)
  21.       ENDIF
  22.    ENDIF
  23. ENDIF
  24.  
  25. RETURN keyer
  26.  
  27. FUNCTION meterbox
  28. PARAMETERS boxline,indexnum,numindex
  29. PRIVATE boxline,length
  30.  
  31. @ boxline+03,20 TO boxline+03,75 DOUBLE
  32.    
  33. * draw meter borders and labels
  34. @ boxline-01,09 TO boxline+1,70
  35. @ boxline+00,10 SAY REPLICATE('░',60)
  36. length = LEN(LTRIM(STR(Lastrec())))
  37. LINE = 'Records Completed : '+SPACE(length)+'/'+LTRIM(STR(Lastrec()))
  38. @ boxline-02,25 SAY LINE
  39. LINE = 'Creating Index Number '+STR(indexnum,2)+' of '+STR(numindex,2)
  40. @ boxline+02,25 SAY LINE
  41. line = 'Indexing '+DBF()+' Database on '+UPPER(SUBSTR(INDEXKEY(0),AT('(',INDEXKEY(0))+1,AT(',',INDEXKEY(0))-AT('(',INDEXKEY(0))-1))
  42. center = (40-LEN(line)/2)
  43. @ boxline+03,center SAY line
  44.    
  45. @ boxline+02,47 SAY STR(indexnum,2)
  46.    
  47. RETURN ''
  48.